﻿
using System;
using System.ComponentModel;

using OpenCvSharp;
namespace Xc.DataAccess.CodeReader.Models.Filters
{
    [TypeConverter(typeof(Size))]
    public class SizeConverter: StructConverter, IValueConverter<string,Size>
    {
        public Size Convert(object tin)
        {
            if (tin.GetType() == typeof(Size))
            {
                return (Size)tin;
            }
            var datas=  GetValues(tin?.ToString());
            return Map(new Size(),datas);
        }

        public string ConvertBack(object tin)
        {
            throw new NotImplementedException();
        }
    }

}
